﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DXWindowsApplication3
{
    public partial class UCLichChieu : UserControl
    {
        public UCLichChieu()
        {
            InitializeComponent();
        }
        void LoadBangSuatChieu()
        {
            string sql = "select * from SUATCHIEU";
            gcSuatChieu.DataSource = DataProvider.LoadTable(sql);
        }
        private void groupControl1_Paint(object sender, PaintEventArgs e)
        {
            LoadBangSuatChieu();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
        }

        private void btnXuat_Click(object sender, EventArgs e)
        {
            //string path = Application.StartupPath + "\\" + "Tenfile.*";
            //gcSuatChieu.ExportToXls("path");
            gcSuatChieu.ExportToXls("D:\\Do an\\SuatChieu.Xls");
            MessageBox.Show("Xuất file thành công!","Thông báo");
        }

    }
}
